package acwing._1_1AlgorithmBasic._4Math;
/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._1_1AlgorithmBasic._4Math
 * @File : Q0868.java
 * @Author : WangRuoyu
 * @Date : 2023/4/4 10:49
 */

import java.io.*;

public class Q0868 {
    // 朴素筛法 O(nlogn)
    static int get_primes1(int n, int[] primes) {
        int cnt = 0;
        boolean[] st = new boolean[n + 1];
        for (int i = 2; i <= n; ++i) {
            if (!st[i]) {
                primes[cnt++] = i;
            }
            for (int j = i + i; j <= n; j += i) {
                st[j] = true;
            }
        }
        return cnt;
    }

    // 埃式筛法 O(nloglogn)
    static int get_primes2(int n, int[] primes) {
        int cnt = 0;
        boolean[] st = new boolean[n + 1];
        for (int i = 2; i <= n; ++i) {
            if (!st[i]) {
                primes[cnt++] = i;
                for (int j = i + i; j <= n; j += i) {
                    st[j] = true;
                }
            }
        }
        return cnt;
    }

    // 线性筛法（欧拉筛法） O(n)
    static int get_primes3(int n, int[] primes) {
        int cnt = 0;
        boolean[] st = new boolean[n + 1];
        for (int i = 2; i <= n; ++i) {
            if (!st[i]) {
                primes[cnt++] = i;
            }
            for (int j = 0; primes[j] <= n / i; j++) {
                st[primes[j] * i] = true;
                if (i % primes[j] == 0) break;
            }
        }
        return cnt;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(System.out));
        String[] words = br.readLine().split(" ");

        int n = Integer.parseInt(words[0]);
        int[] primes = new int[n];
        int res;
//        res = get_primes1(n, primes);
//        res = get_primes2(n, primes);
        res = get_primes3(n, primes);
        wr.write(res + "\n");
        wr.flush();
    }
}

